package com.floatpoint.db;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

public class DbProp {
	Properties props;
	
	public DbProp() {
		props = new Properties();
		
		String filename = this.getClass().getResource("/db.properties").getPath();
		try {
			props.load(new FileInputStream(filename));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public String getValue(String name) {
		return props.getProperty(name);
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		DbProp prop = new DbProp();
		
		System.out.println(prop.getValue("jdbcDriver"));
		System.out.println(prop.getValue("url"));
		System.out.println(prop.getValue("user"));
		System.out.println(prop.getValue("password"));
	}

}
